home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / instan1a / server.frm < prev    next >
Text File  |  1999-10-01  |  3KB  |  138 lines

  1. VERSION 4.00
  2. Begin VB.Form Server 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Net Hood Instant Message"
  5.    ClientHeight    =   4905
  6.    ClientLeft      =   1530
  7.    ClientTop       =   1515
  8.    ClientWidth     =   4095
  9.    Height          =   5340
  10.    Icon            =   "Server.frx":0000
  11.    Left            =   1470
  12.    LinkTopic       =   "Server"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4905
  16.    ScaleWidth      =   4095
  17.    Top             =   1140
  18.    Width           =   4215
  19.    WindowState     =   1  'Minimized
  20.    Begin VB.Timer Timer1 
  21.       Interval        =   3000
  22.       Left            =   1305
  23.       Top             =   4485
  24.    End
  25.    Begin VB.CommandButton Command2 
  26.       Caption         =   "End"
  27.       Height          =   345
  28.       Left            =   0
  29.       TabIndex        =   3
  30.       Top             =   4560
  31.       Width           =   1035
  32.    End
  33.    Begin VB.CommandButton Command1 
  34.       Caption         =   "Send"
  35.       Height          =   345
  36.       Left            =   2925
  37.       TabIndex        =   2
  38.       Top             =   4560
  39.       Width           =   1170
  40.    End
  41.    Begin VB.TextBox txtSent 
  42.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  43.          Name            =   "MS Sans Serif"
  44.          Size            =   12
  45.          Charset         =   0
  46.          Weight          =   700
  47.          Underline       =   0   'False
  48.          Italic          =   0   'False
  49.          Strikethrough   =   0   'False
  50.       EndProperty
  51.       ForeColor       =   &H00FF0000&
  52.       Height          =   2310
  53.       Left            =   -15
  54.       MultiLine       =   -1  'True
  55.       TabIndex        =   1
  56.       Top             =   0
  57.       Width           =   4110
  58.    End
  59.    Begin VB.TextBox txtMessage 
  60.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  61.          Name            =   "MS Sans Serif"
  62.          Size            =   12
  63.          Charset         =   0
  64.          Weight          =   700
  65.          Underline       =   0   'False
  66.          Italic          =   0   'False
  67.          Strikethrough   =   0   'False
  68.       EndProperty
  69.       ForeColor       =   &H000000FF&
  70.       Height          =   2145
  71.       Left            =   -15
  72.       MultiLine       =   -1  'True
  73.       TabIndex        =   0
  74.       Top             =   2340
  75.       Width           =   4110
  76.    End
  77. End
  78. Attribute VB_Name = "Server"
  79. Attribute VB_Creatable = False
  80. Attribute VB_Exposed = False
  81. Option Explicit
  82.  
  83. Const fClient = "C:\Sent.txt"
  84. Const fServe = "C:\Message.txt"
  85.  
  86. Private Sub Send()
  87. Dim fnum As Integer
  88. fnum = FreeFile
  89. Open fClient For Output As fnum
  90. Print #fnum, txtMessage
  91. Close fnum
  92. End Sub
  93.  
  94. Private Sub LoadData()
  95. Dim fnum As Integer
  96. fnum = FreeFile
  97. Open fServe For Input As fnum
  98. txtSent = Input(LOF(fnum), fnum)
  99. Close fnum
  100. End Sub
  101.  
  102.  
  103. Private Sub Command1_Click()
  104. Send
  105. txtMessage = ""
  106. End Sub
  107.  
  108.  
  109. Private Sub Command2_Click()
  110. If FileExists(fServe) Then Kill fServe
  111. If FileExists(fClient) Then Kill fClient
  112. End
  113. End Sub
  114.  
  115. Private Sub Form_Load()
  116. TopZ Me
  117. End Sub
  118.  
  119. Private Sub Form_Unload(Cancel As Integer)
  120. Cancel = True
  121. Window Me, 2
  122. If FileExists(fServe) Then Kill fServe
  123. If FileExists(fClient) Then Kill fClient
  124. txtSent = ""
  125. End Sub
  126.  
  127.  
  128. Private Sub Timer1_Timer()
  129. If FileExists(fServe) Then
  130. LoadData
  131. Window Me, 1
  132. TopZ Me
  133. End If
  134. End Sub
  135.  
  136.  
  137.  
  138.